﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Editor.QuestionInterface
{
    public partial class AlfanumBasedHelperQuestion : HelperQuestionUserControl, AlfanumQuestion
    {
        public AlfanumBasedHelperQuestion()
        {
            InitializeComponent();
        }

        private void utilityButtonAnswer_Click(object sender, EventArgs e)
        {
            string[] answers = Answer.Split(new string[] { "; " }, 
                StringSplitOptions.RemoveEmptyEntries);

            if (answers.Contains(textBoxAns.Text))
            {
                QuestionParent.Result = "DOĞRU CEVAP. TEBRİKLER!";
                QuestionParent.Description = CorrectAnswerDescription;
            }
            else
            {
                QuestionParent.Result = "YANLIŞ CEVAP. TEKRAR DENEYİN.";
                QuestionParent.Description = IncorrectAnswerDescription;
            }
        }

        private void AlfanumBasedHelperQuestion_Load(object sender, EventArgs e)
        {
            transparentLabelQuestion.Text = BodyText;
        }
    }
}
